package edu.zjut.hjg.saas.biz.service.exception;

import edu.zjut.hjg.saas.biz.support.ServiceError;

/**
 * 业务异常
 *
 * @author hjg
 */
public class ServiceException extends Exception {

    private static final long serialVersionUID = -3893117193582197069L;

    private ServiceError      serviceError;

    public ServiceException(ServiceError serviceError) {
        super();
        this.serviceError = serviceError;
    }

    public ServiceException(String message, ServiceError serviceError) {
        super(message);
        this.serviceError = serviceError;
    }

    public ServiceException(Throwable cause, ServiceError serviceError) {
        super(cause);
        this.serviceError = serviceError;
    }

    public ServiceException(String message, Throwable cause, ServiceError serviceError) {
        super(message, cause);
        this.serviceError = serviceError;
    }

    public ServiceError getServiceError() {
        return serviceError;
    }

    public void setServiceError(ServiceError serviceError) {
        this.serviceError = serviceError;
    }

    public String getErrorMessage() {
        return serviceError.getMessage();
    }
}
